UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/bFR+EIgcl+G+crawRJVZ2rUNKbIv/mC4g1Dzy+vLzI=' 
WHERE 
  key_id = '8e38d1db461b4bc234861f46d3db679877956029e5b9404cdf762921d4af68b1' 
  AND (
    token = '/bFR+EIgcl+G+crawRJVZ2rUNKbIv/mC4g1Dzy+vLzI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034