UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DxouAHno1Pob6CZKeDGpv/zCImM1vZQoxlzDlo1C3Yw=' 
WHERE 
  key_id = 'c153912ec141e871ac7c9b47cfde8b927727c9c21e72a7a27928b65cdeb4dce0' 
  AND (
    token = 'DxouAHno1Pob6CZKeDGpv/zCImM1vZQoxlzDlo1C3Yw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018