UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JaZGI3Bs+D7RorsyqgCUg+I8TT8ZWPtDXDzy8vLiZ3A=' 
WHERE 
  key_id = 'dcacba2acd16955267efaaf8cab8b5c63036387558ea6d9ea21e3e8f5f4e753a' 
  AND (
    token = 'JaZGI3Bs+D7RorsyqgCUg+I8TT8ZWPtDXDzy8vLiZ3A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024