UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '75mCBowkctbmwdX0ArHFsjqRsfc+vAXRIpGwESsYYKc=' 
WHERE 
  key_id = 'b1358232d7b3e90569929789f88f4f023bd1b97b5af283219f149428a3ef04d5' 
  AND (
    token = '75mCBowkctbmwdX0ArHFsjqRsfc+vAXRIpGwESsYYKc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034