UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MBE9/zDpCak3n60luVDIy/R6T2WSn9LKeh5NXwJbkfM=' 
WHERE 
  key_id = '3f55484fcabb8cb30e57e3e4302d916b96d409d315697ac8c2f3c1d3aa48907a' 
  AND (
    token = 'MBE9/zDpCak3n60luVDIy/R6T2WSn9LKeh5NXwJbkfM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00070