UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+fTXR3ixlptrCt09yt+fbOJSp5tvyl5Wfw/3jf92kKo=' 
WHERE 
  key_id = '68946f889c9a7f4ec640b91586d2bb254cc343bde2d775e70e298cb984aa26c1' 
  AND (
    token = '+fTXR3ixlptrCt09yt+fbOJSp5tvyl5Wfw/3jf92kKo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044