UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eBiPkx/kiMd1bVHTG6PaVA9uCE+fJ0IfN835j1TmWTI=' 
WHERE 
  key_id = '66b1cbd141f11d47ad07993f0d686dbf314f78b5aae3eab4f657a640b72ccdc0' 
  AND (
    token = 'eBiPkx/kiMd1bVHTG6PaVA9uCE+fJ0IfN835j1TmWTI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038