UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4HHjVOKIaUYubbMMOPlz1pBZzrikx6NLGgFmMGqi5cI=' 
WHERE 
  key_id = 'dec178a133af06819281e0bb2cc35f8093024bb6b385adad83ad102dcc2f43f2' 
  AND (
    token = '4HHjVOKIaUYubbMMOPlz1pBZzrikx6NLGgFmMGqi5cI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039