UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vDEJM3To1iyJe2lBsRIFDSG/CIBVYQpDm4Nxzpvb0SY=' 
WHERE 
  key_id = '685cb93b5e2677cb1ad22d8f1d4c41733845bf81b177708abc0331490e761f60' 
  AND (
    token = 'vDEJM3To1iyJe2lBsRIFDSG/CIBVYQpDm4Nxzpvb0SY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056