UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GNa2sEkFurHZOS8VqxBx2dvRsmEA2UG26LHtx6IXFHQ=' 
WHERE 
  key_id = '3617a94f5d70ff90da7cae3fd86ae6fb5d23036a6989ebd30ac0c27ff3069abe' 
  AND (
    token = 'GNa2sEkFurHZOS8VqxBx2dvRsmEA2UG26LHtx6IXFHQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028