UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MbWGJH/Phgtdh3M19pVzMWjr+c1ewQx1G+qY/+nMgFA=' 
WHERE 
  key_id = 'd3f606dea1adc4c0e64c790b7ee41bffac55a83d27a0ddead1f70f0fbf851896' 
  AND (
    token = 'MbWGJH/Phgtdh3M19pVzMWjr+c1ewQx1G+qY/+nMgFA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00063