UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GgbeiTGAtfO7jeQD5HAIBpJVXWeQbdZ4OjJEIoRw1Ac=' 
WHERE 
  key_id = '72808b4e1fcf4b89d315c63e1f3e7fb61232278e6a117bd856f3d2f18da84480' 
  AND (
    token = 'GgbeiTGAtfO7jeQD5HAIBpJVXWeQbdZ4OjJEIoRw1Ac=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040