UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 't5C/gpACG9vba5VZ/ZgCWfz4IRw9nN7lNky4ZdJIB1g=' 
WHERE 
  key_id = '128c6e2e578401f25d4dabe1e62938449d691faed570e136def656eca48576b1' 
  AND (
    token = 't5C/gpACG9vba5VZ/ZgCWfz4IRw9nN7lNky4ZdJIB1g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030