UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jE5x3SZs9hbQrrp+c2nyj+zLnm4GPPArpV2OuJZ1xE4=' 
WHERE 
  key_id = 'c6dee5c17b966db199960d278bc251a748491058e845ac5753782b4bd24da28a' 
  AND (
    token = 'jE5x3SZs9hbQrrp+c2nyj+zLnm4GPPArpV2OuJZ1xE4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042