UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EoemTN5JC/P4N14AyNeiPZE9dhfSbRmfl5C2Hdj0dLM=' 
WHERE 
  key_id = '5de3266c22500995acdd4c41923fd9f94ba81ed9a2db200559e0c05c0cc03367' 
  AND (
    token = 'EoemTN5JC/P4N14AyNeiPZE9dhfSbRmfl5C2Hdj0dLM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038