UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WHISzDvoWCXLWgwroP5YH6pPxi8OnhRPzVSuFYLqM+g=' 
WHERE 
  key_id = '7f8f9a9c2b11f038b6326cde49502b8bb2653f7e64adb05dde40fe720b9a6636' 
  AND (
    token = 'WHISzDvoWCXLWgwroP5YH6pPxi8OnhRPzVSuFYLqM+g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031