UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XHGb7tgzXRMe88iJHLONGu4NOH6RGX0iHs0M1eYJlPs=' 
WHERE 
  key_id = 'fba3fdc692c76542faeefc144e7d8933da3ed61b4634d90ad45e5aaa474e0a21' 
  AND (
    token = 'XHGb7tgzXRMe88iJHLONGu4NOH6RGX0iHs0M1eYJlPs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049