UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tcSkuM6jf3/HvyRpiNV27TScvHkNJLj3y/qFhoyRXwc=' 
WHERE 
  key_id = 'ec8f30f82bfe416488bc7286a3f9eea577c212b0817a4f9a36e968972660a94f' 
  AND (
    token = 'tcSkuM6jf3/HvyRpiNV27TScvHkNJLj3y/qFhoyRXwc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031