UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DxFmnGlj3IXt5Z673zslfJqMYeRx+/J7sCoHeI5OHNA=' 
WHERE 
  key_id = '52d17b72b97836b984fbf23f28781982e25c274aaeb1c2fcc399abef05e81c8c' 
  AND (
    token = 'DxFmnGlj3IXt5Z673zslfJqMYeRx+/J7sCoHeI5OHNA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032