UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+kYb1UH735v4E0qyx+PpyK0b31uLZ/cTVlCILqGWf3o=' 
WHERE 
  key_id = '1351697d863e313aa43fce25c64ae54a3b28b029b588020c79f89cb10d64caa4' 
  AND (
    token = '+kYb1UH735v4E0qyx+PpyK0b31uLZ/cTVlCILqGWf3o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034