UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OOFGlXKb0IV3SU2VTo5fFcR5Xo+Dcr68o4M2HtFs90c=' 
WHERE 
  key_id = '0d1aecffc3d862396edce5e06fadc1d78e0e60450c9e6f31ca7f825c60713faf' 
  AND (
    token = 'OOFGlXKb0IV3SU2VTo5fFcR5Xo+Dcr68o4M2HtFs90c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029