UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '29N461HTLEijHhNURGjnzqG4xhwTwBEl73/OJS24ARY=' 
WHERE 
  key_id = 'ff9481bbd2741ddb24233b79c8ddf408ba3496c8ad591d9bc1be6cdc76db7b77' 
  AND (
    token = '29N461HTLEijHhNURGjnzqG4xhwTwBEl73/OJS24ARY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038