UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uCacTVtEGhDoPEpbPXNAyJHEmBlkI+s3DOU08wJDfpo=' 
WHERE 
  key_id = '7bef7a978652ec14ec93a4fc19c9033a75df62b4e2fa45dd9c6e17271ff48adf' 
  AND (
    token = 'uCacTVtEGhDoPEpbPXNAyJHEmBlkI+s3DOU08wJDfpo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030