UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0RSrx6//2PdJN8uWKOwMqOqCSpCFgQ4K8bp1I6mOONc=' 
WHERE 
  key_id = 'dee534b47fdece1d0824916bae6bdf62eda41a9753e5616a13ad5180ce2620c3' 
  AND (
    token = '0RSrx6//2PdJN8uWKOwMqOqCSpCFgQ4K8bp1I6mOONc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038