UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rSkAH1Dsv2BFwfiPuosmaxzuhHC88gOtCcqgvXhM8LM=' 
WHERE 
  key_id = 'b624dce5c22cd35194a4354db3f1d5583c6746d32e5f8201b72795d6694aa2ba' 
  AND (
    token = 'rSkAH1Dsv2BFwfiPuosmaxzuhHC88gOtCcqgvXhM8LM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026