UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kOvSPEItigG+aajry92grT4aJtxcTr5H82q/QwK3aco=' 
WHERE 
  key_id = '2b8bb86bb65adefa48f181b6ac2111194e3439d0feaee95faf075f21b547c40d' 
  AND (
    token = 'kOvSPEItigG+aajry92grT4aJtxcTr5H82q/QwK3aco=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031