UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WzBcydL1qeuB/QfnNkjZMgh8CoeJ6Zl2MUyqx+xpxc0=' 
WHERE 
  key_id = 'ec75f24a6eb1a89614fe26663e7ac11e1542b7b59b539bc66de22b67dba652b5' 
  AND (
    token = 'WzBcydL1qeuB/QfnNkjZMgh8CoeJ6Zl2MUyqx+xpxc0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040