UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '65jJaULugrOQQF8bqWyHcATHTrL1/LitqGN/0k6+63Y=' 
WHERE 
  key_id = '778f0d319dbf4552f01ff468aca8537783a1c543a05aeb37ea536a5c108f6431' 
  AND (
    token = '65jJaULugrOQQF8bqWyHcATHTrL1/LitqGN/0k6+63Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041