UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5W8ne0OqXcDLnFnba6nQoqfCbj7WvW5EHn9SNDcD+E8=' 
WHERE 
  key_id = '5302c63e94b029a7db83dbd2048b0406989c69ab28f5074e61c6551ae13ee21d' 
  AND (
    token = '5W8ne0OqXcDLnFnba6nQoqfCbj7WvW5EHn9SNDcD+E8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00058