UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'z3JfTU3L06ihfTyQC1xx8/uB74kQc0bliMQh/NqgHw4=' 
WHERE 
  key_id = 'e744d0491d0b8a3747d696fe3c38644ab5af5a400e2ea487e5cea051f5ade673' 
  AND (
    token = 'z3JfTU3L06ihfTyQC1xx8/uB74kQc0bliMQh/NqgHw4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025