UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VPswOPzW5H1pxWlZqi//0f8ld8VtJB+ag54eoF8+qdo=' 
WHERE 
  key_id = 'a674e73c35694d309be95b4ee035bc57b49045ab3f3d33491dc26fa7c5e40ab2' 
  AND (
    token = 'VPswOPzW5H1pxWlZqi//0f8ld8VtJB+ag54eoF8+qdo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035