UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zYEZYzEGmVw3XR1dqzps2z+dal78DGoBbDOAsKmo2/A=' 
WHERE 
  key_id = 'ac5f8a4bb844f241d5cd9b5eec36db9f7a0899d613a9181d7983763f09c2e5a2' 
  AND (
    token = 'zYEZYzEGmVw3XR1dqzps2z+dal78DGoBbDOAsKmo2/A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025