UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IVw6EpW1P0mXenJp6YvIV5rdrA/ts50TbMPtaJcjUP0=' 
WHERE 
  key_id = '6ec6e4f9d3748cb69781d39576f3de3dc909fd6d16a55073b26a30bbe868df23' 
  AND (
    token = 'IVw6EpW1P0mXenJp6YvIV5rdrA/ts50TbMPtaJcjUP0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044