UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DXNu/zplW3/aIA+vHHxk09AZvOjKULlJ7r7GSHeKSO0=' 
WHERE 
  key_id = 'f332e389f958cf808a5e573c87455275304e592090254e2b9e889a5cfd3278c6' 
  AND (
    token = 'DXNu/zplW3/aIA+vHHxk09AZvOjKULlJ7r7GSHeKSO0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023