UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3j7YB/SDNXPdjfiRAYkYf8bSld/eCOWZWjQrw85qbSw=' 
WHERE 
  key_id = '1fab7c5ac1b7cac97547194dfe52e1a9f8439c5d2c1abd0f12e441fbf5a9f357' 
  AND (
    token = '3j7YB/SDNXPdjfiRAYkYf8bSld/eCOWZWjQrw85qbSw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022